import request from '@/utils/request'

/**
* 总成分页查询
* @param {查询条件} data
*/
export function listproduct(query) {
  return request({
    url: '/set/product/list',
    method: 'get',
    params: query,
  })
}
export function listAllproduct(query) {
  return request({
    url: '/set/product/interface',
    method: 'get',
    params: query,
  })
}


/**
* 新增总成
* @param data
*/
export function addproduct(data) {
  return request({
    url: '/set/product',
    method: 'post',
    data: data,
  })
}

/**
* 修改总成
* @param data
*/
export function updateproduct(data) {
  return request({
    url: '/set/product',
    method: 'PUT',
    data: data,
  })
}

/**
* 获取总成详情
* @param {Id}
*/
export function getproduct(id) {
  return request({
    url: 'set/product/' + id,
    method: 'get'
  })
}

/**
* 删除总成
* @param {主键} pid
*/
export function delproduct(pid) {
  return request({
    url: 'set/product/' + pid,
    method: 'delete'
  })
}

// 导出总成
export function exportproduct(query) {
  return request({
    url: 'set/product/export',
    method: 'get',
    params: query
  })
}
// 下载模板
export function importTemplate() {
  return request({
    url: '/set/product/importTemplate',
    method: 'get',
  })
}
